<!--首页-->
<template>
  <div>
    <div class="ibody">
      <header>
        <h1>博客网站</h1>
        <h2>喜欢专研前后端各种技术，希望在面试中能得到面试官认可。</h2>
        <div class="logo"><a href="/"></a></div>
        <nav id="topnav">
          <router-link to="/">首页</router-link>
          <router-link to="/about">关于我</router-link>
          <router-link to="/newlist">慢生活</router-link>
          <router-link to="/share">模板分享</router-link>
          <router-link to="/new">模板主题</router-link>
        </nav>
      </header>
      <article>
        <div class="banner">
          <ul class="texts">
            <p>
              Constantly exploring new technologies is our biggest driving
              force.
            </p>
            <p>不断探索新的技术，就是自己最大的动力。</p>
          </ul>
        </div>
        <div class="bloglist">
          <h2>
            <p><span>推荐</span>文章</p>
          </h2>
          <!--循环遍历后台传输数据-->
          <template v-for="(item, index) in blog_message">
          <div class="blogs" :key="index">
            <h3><a href="/">{{item.title}}</a></h3>
            <figure><img :src="Url+item.images" /></figure>
            <ul>
              <p>{{item.content}}</p>
              <a href="/" target="_blank" class="readmore">阅读全文&gt;&gt;</a>
            </ul>
            <p class="autor">
              <span>作者：李志伟</span
              ><span>分类：【<a href="/">日记</a>】</span
              ><span>浏览（<a href="/">459</a>）</span
              ><span>评论（<a href="/">30</a>）</span>
            </p>
            <div class="dateview">2021-04-08</div>
          </div>
          </template>
        </div>
      </article>
      <aside>
        <div class="avatar">
          <a href="about.html"><span>关于李志伟</span></a>
        </div>
        <div class="topspaceinfo">
          <h1>执子之手，与子偕老</h1>
          <p>于千万人之中，我遇见了我所遇见的人....</p>
        </div>
        <div class="about_c">
          <p>网名：编程小能手</p>
          <p>职业：Web前端设计师、网页设计</p>
          <p>籍贯：四川省—成都市</p>
          <p>电话：17628223627</p>
          <p>邮箱：1374363223@qq.com</p>
        </div>
        <div class="bdsharebuttonbox">
          <a
            href="#"
            class="bds_qzone"
            data-cmd="qzone"
            title="分享到QQ空间"
          ></a
          ><a
            href="#"
            class="bds_tsina"
            data-cmd="tsina"
            title="分享到新浪微博"
          ></a
          ><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a
          ><a
            href="#"
            class="bds_renren"
            data-cmd="renren"
            title="分享到人人网"
          ></a
          ><a
            href="#"
            class="bds_weixin"
            data-cmd="weixin"
            title="分享到微信"
          ></a
          ><a href="#" class="bds_more" data-cmd="more"></a>
        </div>
        <div class="tj_news">
          <h2>
            <p class="tj_t1">最新文章</p>
          </h2>
          <ul>
            <li><a href="/">犯错了怎么办？</a></li>
            <li><a href="/">两只蜗牛艰难又浪漫的一吻</a></li>
            <li><a href="/">春暖花开-走走停停-发现美</a></li>
            <li><a href="/">琰智国际-Nativ for Life官方网站</a></li>
            <li><a href="/">个人博客模板（2021草根寻梦）</a></li>
            <li><a href="/">简单手工纸玫瑰</a></li>
            <li><a href="/">响应式个人博客模板（蓝色清新）</a></li>
            <li><a href="/">蓝色政府（卫生计划生育局）网站</a></li>
          </ul>
          <h2>
            <p class="tj_t2">推荐文章</p>
          </h2>
          <ul>
            <li><a href="/">犯错了怎么办？</a></li>
            <li><a href="/">两只蜗牛艰难又浪漫的一吻</a></li>
            <li><a href="/">春暖花开-走走停停-发现美</a></li>
            <li><a href="/">琰智国际-Nativ for Life官方网站</a></li>
            <li><a href="/">个人博客模板（2021草根寻梦）</a></li>
            <li><a href="/">简单手工纸玫瑰</a></li>
            <li><a href="/">响应式个人博客模板（蓝色清新）</a></li>
            <li><a href="/">蓝色政府（卫生计划生育局）网站</a></li>
          </ul>
        </div>
        <div class="links">
          <h2>
            <p>技术栈面板</p>
          </h2>
          <ul>
            <li>vuex</li>
            <li>vue-router</li>
            <li>vue-router</li>
          </ul>
        </div>
        <div class="copyright">
          <ul>
            <p>Design by <a href="/">DanceSmile</a></p>
            <p>蜀ICP备11002373号-1</p>
          </ul>
        </div>
      </aside>
      <div class="clear"></div>
      <!-- 清除浮动 -->
    </div>
    <div style="text-align: center">
      <p>
        来源：<a href="http://www.mycodes.net/" target="_blank">个人制作</a>
      </p>
    </div>
  </div>
</template>

<script>
import { getMessage } from "@/server/api.js";
export default {
  data() {
    return {
      Url:process.env.VUE_APP_ACS_BASE_API,
      blog_message:[]
    }
  },
  mounted() {
    this.init()
  },
  methods: {
    init() {
      getMessage().then(res=>{
        if(res.status===200){
          this.$message.success("加载成功!")
          this.blog_message = res.data.messages
        }
      })
    },
  },
};
</script>
<style lang='scss' scoped>
/* CSS Document */
.banner {
  background: url("../../assets/images/banner.jpg") no-repeat center;
  height: 290px;
  margin: 10px auto;
  width: 100%;
  font-size: 16px;
  font-family: "Microsoft Yahei", Arial, Helvetica, sans-serif;
}
.texts {
  line-height: 36px;
  padding: 90px 0 0 40px;
  text-shadow: 1px 1px rgba(255, 255, 255, 0.3);
}
.texts p {
  -webkit-transition: all 1s;
  -moz-transition: all 1s;
  -o-transition: all 1s;
  transition: all 1s;
  -webkit-transform: translate(60px);
  -moz-transform: translate(60px);
  -o-transform: translate(60px);
  -ms-transform: translate(60px);
  transform: translate(60px);
}
.texts p:hover {
  padding-left: 20px;
}
.texts p:nth-child(1) {
  -webkit-animation: animations 3s ease-out 1s backwards;
  -moz-animation: animations 3s ease-out 1s backwards;
  -o-animation: animations 3s ease-out 1s backwards;
  -ms-animation: animations 3s ease-out 1s backwards;
  animation: animations 3s ease-out 1s backwards;
}
.texts p:nth-child(2) {
  -webkit-animation: animations 3s ease-out 4s backwards;
  -moz-animation: animations 3s ease-out 4s backwards;
  -o-animation: animations 3s ease-out 4s backwards;
  -ms-animation: animations 3s ease-out 4s backwards;
  animation: animations 3s ease-out 4s backwards;
}
@-webkit-keyframes animations {
  0% {
    -webkit-transform: translate(0);
    opacity: 0;
  }
  50% {
    -webkit-transform: translate(30px);
    opacity: 0.5;
  }
  100% {
    -webkit-transform: translate(60px);
    opacity: 1;
  }
}
@-moz-keyframes animations {
  0% {
    -moz-transform: translate(0);
    opacity: 0;
  }
  50% {
    -moz-transform: translate(30px);
    opacity: 0.5;
  }
  100% {
    -moz-transform: translate(60px);
    opacity: 1;
  }
}
@-o-keyframes animations {
  0% {
    -o-transform: translate(0);
    opacity: 0;
  }
  50% {
    -o-transform: translate(30px);
    opacity: 0.5;
  }
  100% {
    -o-transform: translate(60px);
    opacity: 1;
  }
}
@-ms-keyframes animations {
  0% {
    -ms-transform: translate(0);
    opacity: 0;
  }
  50% {
    -ms-transform: translate(30px);
    opacity: 0.5;
  }
  100% {
    -ms-transform: translate(60px);
    opacity: 1;
  }
}
@keyframes animations {
  0% {
    transform: translate(0);
    opacity: 0;
  }
  50% {
    transform: translate(30px);
    opacity: 0.5;
  }
  100% {
    transform: translate(60px);
    opacity: 1;
  }
}
/* 左侧栏文章列表 */
.bloglist h2 {
  border-bottom: #474645 2px solid;
  margin: 0 8px 20px 8px;
  height: 26px;
  overflow: hidden;
  line-height: 28px;
  font-size: 16px;
  font-family: "Microsoft Yahei", Arial, Helvetica, sans-serif;
  letter-spacing: 2px;
}
.bloglist h2 p {
  background: #474645;
  width: 180px;
  color: #fff;
  text-align: center;
  box-shadow: #999 4px 5px 1px;
}
.bloglist h2 p span {
  color: #38b3d4;
}
.blogs {
  margin: 0 20px 20px 20px;
  position: relative;
}
.blogs h3 {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 15px;
  transition: all 0.5s;
}
.blogs h3 a {
  color: #474645;
}
.blogs h3:hover {
  text-decoration: underline;
}
.blogs figure {
  float: left;
  width: 25%;
  overflow: hidden;
}
.blogs figure img {
  width: 100%;
  margin: auto;
  -moz-transition: all 0.5s;
  -webkit-transition: all 0.5s;
  -o-transition: all 0.5s;
  transition: all 0.5s;
}
.blogs figure:hover img {
  -moz-transform: scale(1.1);
  -webkit-transform: scale(1.1);
  -o-transform: scale(1.1);
  -ms-transform: scale(1.1);
}
.blogs ul {
  float: right;
  line-height: 20px;
  width: 72%;
  color: #474645;
}
.blogs ul:hover {
  cursor: pointer;
}
.autor {
  overflow: hidden;
  clear: both;
  margin: 10px 0 0 0;
  display: inline-block;
  line-height: 26px;
  height: 26px;
  color: #838383;
  background: #f6f6f6;
  width: 100%;
}
.autor span {
  margin: 0 10px;
}
.autor span a {
  color: #759b08;
}
a.readmore {
  background: #e41635;
  color: #fff;
  padding: 5px 10px;
  float: right;
  margin: 20px 0 0 0;
}
.blogs::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  background: #cac1c1;
  border: 2px solid #fff;
  left: -27px;
  -webkit-transition: all 1s;
  -moz-transition: all 1s;
  -o-transition: all 1s;
  transition: all 1s;
}
.blogs:hover::before {
  background: #474645;
}
.dateview {
  position: absolute;
  left: -125px;
  top: 0px;
  z-index: 1;
  color: #f5f5f5;
}
.blogs::after {
  content: "";
  width: 121px;
  height: 29px;
  position: absolute;
  left: -148px;
  top: -9px;
  z-index: 0;
  background: #474645 url("../../assets/images/ti.png") no-repeat;
  opacity: 0;
  -webkit-transition: all 1s;
  -moz-transition: all 1s;
  -o-transition: all 1s;
  transition: all 1s;
}
.blogs:hover::after {
  opacity: 1;
}
/* 右侧栏个人档案 */
.avatar {
  margin: 10px auto;
  width: 160px;
  height: 160px;
  border-radius: 100%;
  overflow: hidden;
}
.avatar a {
  display: block;
  padding-top: 100px;
  width: 160px;
  background: url("../../assets/images/photos.jpg") no-repeat;
  background-size: 160px 160px;
}
.avatar a span {
  display: block;
  margin-top: 63px;
  padding-top: 8px;
  width: 160px;
  height: 55px;
  text-align: center;
  line-height: 20px;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  -webkit-transition: margin-top 0.2s ease-in-out;
  -moz-transition: margin-top 0.2s ease-in-out;
  -o-transition: margin-top 0.2s ease-in-out;
  transition: margin-top 0.2s ease-in-out;
}
.avatar a:hover span {
  display: block;
  margin-top: 0;
}
.topspaceinfo {
  background: #e41635;
  padding: 40px 20px;
  color: #fff;
  text-shadow: 1px 1px rgba(0, 0, 0, 0.3);
}
.topspaceinfo h1 {
  font-size: 16px;
  line-height: 40px;
  font-weight: bold;
}
.about_c {
  margin: 10px 0;
  color: #fff;
  line-height: 26px;
}
.about_c p:first-child,
.about_c p:nth-child(2),
.about_c p:nth-child(3),
.about_c p:nth-child(4),
.about_c p:last-child {
  background: url("../../assets/images/about_c.png") no-repeat;
}
.about_c p:first-child {
  background-position: 15px 6px;
}
.about_c p:nth-child(2) {
  background-position: 15px -20px;
}
.about_c p:nth-child(3) {
  background-position: 15px -48px;
}
.about_c p:nth-child(4) {
  background-position: 15px -70px;
}
.about_c p:last-child {
  background-position: 15px -97px;
}
.about_c p {
  display: block;
  padding-left: 40px;
}
.about_c p:hover {
  background: #222;
}
.bdsharebuttonbox {
  margin: 20px;
  clear: both;
} /* 百度分享 */
/* 右侧推荐信息列表 */
.tj_news h2,
.links h2 {
  font-size: 16px;
  font-family: "Microsoft Yahei", Arial, Helvetica, sans-serif;
  color: #fff;
}
.tj_news h2 p,
.links h2 p {
  height: 40px;
  line-height: 40px;
  width: 100px;
  padding: 0 0 0 30px;
  border-radius: 0 20px 20px 0;
  text-shadow: rgba(0, 0, 0, 0.65) 1px 1px;
}
.tj_t1 {
  background: #0f9c7c;
}
.tj_t2 {
  background: #b0e516;
}
.tj_news ul {
  margin: 20px 0 20px 20px;
}
.tj_news ul li a:hover,
.links ul li a:hover {
  text-decoration: underline;
  color: #fff;
}
.tj_news ul li {
  height: 25px;
  line-height: 25px;
  clear: both;
  padding-left: 5px;
  overflow: hidden;
  padding-left: 15px;
  background: url("../../assets/images/li.jpg") no-repeat left center;
}
.tj_news ul li a,
.links ul li a {
  color: #bbbbbb;
}
/* 友情链接 */
.links h2 p {
  background: #222;
}
.links ul {
  margin: 20px 0;
}
.links ul li {
  height: 30px;
  line-height: 30px;
  text-align: center;
  border-bottom: #333 1px dashed;
  margin: 0 40px;
}
</style>